import { baseRequest } from '@/common/axios'
import store from '@/storeVuex/index'
const request = (url, ...arg) => baseRequest(`/api/WeChat/Monitoring/${url}`, ...arg)
import appConfig from '@/static/app.config.js'
export default {
	GetMonitoringLiveForecastDatas(data) {
		return request('GetMonitoringLiveForecastDatas', data, 'post')
	},
	//获取雷达数据
	GetRadarDatas(data) {
		return request('GetRadarDatas', data, 'get')
	},
	//获取云图站号
	GetCloudSites(data) {
		return request('GetCloudSites', data, 'get')
	},
	//获取云图数据
	GetCloudDatas(data) {
		return request('GetCloudDatas', data, 'get')
	},

	getAll(data) {
		return baseRequest('/api/wpd-sanming/data/object/all?projectId=3bc0fb05339a46d7966a7abac9fc3516', data, 'get')
	},
	// 时序数据接口
	getMonitorData(data) {
		return baseRequest('/api/wpd-sanming/data/getMonitorData', data, 'get')
	},
	// 获取多个
	getMonitorDatas(data) {
		return baseRequest('/api/wpd-sanming/data/getMonitorDatas', data, 'get')
	},
	// 获取监测基本数据
	getInfo(data) {
		return baseRequest('/api/wpd-sanming/data/object/info', data, 'get')
	},
	// 获取雨量站历史数据
	getHistoryRain(data) {
		return baseRequest('/api/wpd-sanming/magnitudeRain/getHistoryRain', data, 'get')
	},
	// getWaterSites(data) {
	// 	return baseRequest(appConfig['sanming'] + '/sanming/三明水文站.json', data, 'get')
	// },
	// getWorkSites(data) {
	// 	return baseRequest(appConfig['sanming'] + '/sanming/三明水库站.json', data, 'get')
	// },
	getJson(url) {
		return baseRequest('/api/sanming/' + url, {}, 'get')
	},
	getJsonUrl(url) {
		return baseRequest('/data/' + url, {}, 'get')
	},
	// 缓存站点数据
	async stationToLogtdLattd(data) {
		let resp = uni.getStorageSync(data)
		if (resp) {
			return resp
		} else {
			resp = await baseRequest('/api/wpd-sanming/regimen/stationToLogtdLattd', { stationType: data }, 'get')
			uni.setStorageSync(data, resp)
			return resp
		}
	},
	//地灾打点
	async getDzSite(data) {
		console.info(`store:`, store)
		let dzdGeoJson = await store.dispatch('getDzSite')
		console.info(`dzdGeoJson:`, dzdGeoJson)
		if (dzdGeoJson) {
			return dzdGeoJson
		} else {
			dzdGeoJson = await baseRequest(appConfig['geoserver'] + '/geoserver/sanming/wms', data, 'get', false)
			await store.dispatch('getDzSite', dzdGeoJson)
			return dzdGeoJson
		}
	},
	GetLasted(data) {
		return baseRequest('/api/Meteo/GeoImage/GetLasted', data, 'get')
	},
	getRadarCloundImg(data) {
		return baseRequest('/api/Meteo/GeoImage/GetPage', data, 'get')
	},
	getLastTyData(data) {
		return baseRequest('/api/Meteo/Typhoon/GetLastTyphoonDatas', data, 'get')
	},
	GetObsSequence(data) {
		return baseRequest('/api/Meteo/Obs/GetObsSequence', data, 'post')
	},

	// 雨量站
	getRain(data) {
		return baseRequest('/api/smsl/biz/getRain', data, 'get')
	},
	// 色斑图
	getStainChart(data) {
		return baseRequest('/api/smsl/biz/getStainChart', data, 'get')
	},
	// 时序图
	getRainTs(data) {
		return baseRequest('/api/smsl/biz/getRainTs', data, 'get')
	},
	// 获取雨量统计数据
	getMagnitudeRainAreaByType(data) {
		return baseRequest('/api/wpd-sanming/magnitudeRain/getMagnitudeRainAreaByType', data, 'get')
	},
	getHistoryRainMonitorSegment(data) {
		return baseRequest('/api/wpd-sanming/magnitudeRain/getHistoryRainMonitorSegment' + data, {}, 'post')
	},

	regimenQuery(data) {
		return baseRequest('/api/wpd-sanming/regimen/regimenQuery', data, 'get')
	},
	regimenAllQuery(data) {
		return baseRequest('/api/wpd-sanming/regimen/regimenAllQuery', data, 'get')
	},
	getStatTextByType(data) {
		return baseRequest('/api/wpd-sanming/magnitudeRain/getStatTextByType', data, 'get')
	},
	// 应急物资
	goodsMaterials(data) {
		return baseRequest('/api/wpd-sanming/enterpConting/goodsMaterials', data, 'get')
	},
	// 企业台账
	enterpriseLedger(data) {
		return baseRequest('/api/wpd-sanming/enterpConting/enterpriseLedger', data, 'get')
	},
	// 避难场所
	takeRefuge(data) {
		return baseRequest('/api/wpd-sanming/enterpConting/takeRefuge', data, 'get')
	},
	// 安置点
	azdJson(data) {
		return baseRequest(appConfig['geoserver'] + '/geoserver/sanming/wms', data, 'get', {
			headers: {
				'X-Credentials': 'private-user=smuser',
				'Y-credentials': 'private-pw=sanming@123'
			}
		})
	},
	// 危险区
	wxqJson(data) {
		return baseRequest(appConfig['geoserver'] + '/geoserver/sanming/wms', data, 'get', {})
	},
	// 转移路线
	zyLineJson(data) {
		return baseRequest(appConfig['geoserver'] + '/geoserver/sanming/wms', data, 'get', {})
	},
	zjsjJson(data) {
		return baseRequest('/api/wpd-sanming/project/queryobjects', data, 'get', {})
	},
	// 极值
	GetExtremum(data) {
		return baseRequest('/api/Meteo/Obs/GetExtremum', data, 'post', {})
	},
	// 极值
	GetExtremumSiteNoAndValue(data) {
		return baseRequest('/api/Meteo/Obs/GetExtremumSiteNoAndValue', data, 'post', {})
	},
	// 时序图
	GetObsSequence(data) {
		return baseRequest('/api/Meteo/Obs/GetObsSequence', data, 'get', {})
	},
	//视频点位
	getCameraData(data) {
		return baseRequest('/api/wpd-sanming/monitor/getCameraData', data, 'get', {})
	}
}

// /wpd-sanming/regimen/regimenAllQuery?areaId=350400000000&begin=2023-05-21%2010%3A08%3A49&end=2023-05-22%2010%3A08%3A49&roleType=CITY&stationType=WPStationZQ%2CWPStationZZ%2CWPStationRR&projectId=3bc0fb05339a46d7966a7abac9fc3516
// /wpd-sanming/regimen/regimenQuery?areaId=350400000000&begin=2023-05-21%2010%3A08%3A49&end=2023-05-22%2010%3A08%3A49&roleType=CITY&stationType=WPStationZQ%2CWPStationZZ%2CWPStationRR&projectId=3bc0fb05339a46d7966a7abac9fc3516
